home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 08 - 1992 / 08.02 Jun 92 / Generic Virus Detection / Data.c < prev    next >
Encoding:
Text File  |  1992-05-26  |  335 b   |  20 lines  |  [TEXT/MPS ]

  1. /* data.c: data structure operations (static allocation) for dynamic AND Boyer-Moore algs */
  2.  
  3. int read_array(fp, array)
  4. FILE *fp;
  5. char array[];
  6. {
  7.   char c;
  8.   int n;
  9.   n = 0;
  10.   while(((c = fgetc(fp)) != EOF) && (n <     MAXSIZE)) /* Read one element */
  11.   {
  12.     array[n] = c;
  13.     n++;
  14.   }
  15.   if (c != EOF)
  16.     ungetc(c, fp);
  17.   return(n);
  18. }
  19.  
  20.